function [sel, lmode] = listcontrol(pathflag)
% dispatch data display based on a click on the list

global CONTROL;
sel=[];
lmode = 1; % flag for detected click mode - 1 for "open", 0 for "normal"
htag = findobj('Tag', 'datac_main');
s=get(htag, 'SelectionType');
if(isempty(CONTROL)) 
   QueMessage('[Listcontrol] No Worksheet data (CONTROL is empty!) ')
   return
else
   nsf = size(CONTROL);
end
h2 = findobj('Tag', 'Path');
path = get(h2, 'String');
h2=findobj('Tag', 'CTL');
sel = get(h2, 'Value');
% display(sprintf('listcontrol: s=%s', s));
switch (s)
case 'open'
   lmode = 1;
otherwise
   lmode = 0;
end
return;


